<template>
    <div id="app1">
        <el-row class="maxHeader">
<!--            PC端-->
            <el-col :span="4" :xs="5"  :offset="0">
                <router-link to="/">
                    <img :style="[headerImg,Center]" src="../assets/images/nav-logo.png" alt="">
                </router-link>
            </el-col>
            <el-col :span="12" :xs="12" class="hidden-xs-only" :style="headerLheight">
                <el-row :gutter="20">
                    <el-col :lg="3" :md="4" class="hidden-sm-and-down dh-ttl1" :style="textStyle">
<!--                        <li :class="{'bgcolor1':actives===i}" @click="changeStyle1(i)" >-->
                            <li>
                                <router-link class="layui-icon layui-icon-find-fill" to="/">
                                发现</router-link></li>
                    </el-col>
<!--                    <el-col :span="4" :style="textStyle" class="HoverStyle">-->
<!--                        <router-link to="/" class="layui-icon layui-icon-cellphone-fine" :style="[fontColor2,textD]">下载App</router-link>-->
<!--                    </el-col>-->
                    <el-col :lg="4" :md="4" :style="textStyle" class="hidden-sm-and-down HoverStyle">
                        <li>
                            <router-link to="/myGuanzhu" class="layui-icon layui-icon-star">
                            关注</router-link></li>
                    </el-col>
                    <el-col :lg="3" :md="4" :style="textStyle" class="hidden-sm-and-down XiaoXi HoverStyle">
                        <li>
                            <router-link to="/jianxinleft" class="layui-icon layui-icon-notice">
                            消息
                            <el-badge :value="1" class="item"/>
                            <template>
                                <ul class="xiaoxi">
                                    <router-link to="jianxinleft"><li><i class="el-icon-chat-square"></i><a>评论</a></li></router-link>
                                    <router-link to="jxCont2"><li><i class="el-icon-message"></i><a>简信</a></li></router-link>
                                    <router-link to="jxCont3"><li><i class="el-icon-upload2"></i><a>投稿请求</a></li></router-link>
                                    <router-link to="jxCont4"><li><i class="el-icon-star-on"></i><a>喜欢和赞</a></li></router-link>
                                    <router-link to="jxCont5"><li><i class="el-icon-s-custom"></i><a>关注</a></li></router-link>
                                    <router-link to="jxCont6"><li><i class="layui-icon layui-icon-rmb"></i><a>赞赏和付费</a></li></router-link>
                                    <router-link to="jxCont7"><li><i class="el-icon-more"></i><a>其他提醒</a></li></router-link>
                                </ul>
                            </template>
                        </router-link></li>
                    </el-col>

<!--                 导航——窗口<=sm  -->
                    <el-col :span="6" :md="6" class="Home">
                        <i class="el-icon-s-unfold"></i>
                        <ul>
                            <router-link v-for="(Dhyc,Dh) in list2" :key="Dh" :to="{path:Dhyc.path}"><li>
                                <i :class="Dhyc.icon"> {{Dhyc.title}}</i>
                            </li></router-link>
                        </ul>
                    </el-col>

                    <el-col :span="8" :md="11" :offset="1">
                        <el-popover trigger="click">
                            <div id="History">
                                <el-row>
                                        <el-col :span="15">
                                            <p>热门搜索</p>
                                        </el-col>
                                        <el-col :span="9">
                                            <button class="el-icon-refresh-left" @click="changeTab2">换一批</button>
                                        </el-col>
                                        <div style="margin-top: 10px" v-if="shows2 === 'shows3'">
                                            <button :style="mrBtn">区块链</button>
                                            <button :style="mrBtn">小程序</button>
                                            <button :style="mrBtn">vue</button>
                                            <button :style="mrBtn">毕业</button>
                                            <button :style="mrBtn">PHP</button>
                                            <button :style="mrBtn">故事</button>
                                            <button :style="mrBtn">flutter</button>
                                            <button :style="mrBtn">理财</button>
                                            <button :style="mrBtn">没事</button>
                                            <button :style="mrBtn">投稿</button>
                                        </div>
                                        <div style="margin-top: 10px" v-else>
                                            <button :style="mrBtn">手账</button>
                                            <button :style="mrBtn">书法</button>
                                            <button :style="mrBtn">PPT</button>
                                            <button :style="mrBtn">穿塔</button>
                                            <button :style="mrBtn">打碗碗花</button>
                                            <button :style="mrBtn">简书</button>
                                            <button :style="mrBtn">姥姥的澎湖湾</button>
                                            <button :style="mrBtn">设计</button>
                                            <button :style="mrBtn">创业</button>
                                            <button :style="mrBtn">交友</button>
                                        </div>
                                    </el-row>
                            </div>
                            <div slot="reference" class="Search3">
                                <input class="Search1 el-icon-search" v-model="input" placeholder="搜索" :style="inputStyle"/>
                                <i class="el-icon-search serch"></i>
                            </div>
                        </el-popover>
                    </el-col>
                </el-row>
            </el-col>
            <el-col :span="8" :xs="8" class="hidden-xs-only" :style="headerLheight">
                <el-row :gutter="20">
                    <el-col :span="3" :sm="4" :offset="2">
                        <el-popover width="236" trigger="click">
                                <div style="border-bottom: 1px solid #eee;z-index: 5;width: 100%;padding:6px 0px 15px 0px">
                                    <p class="el-icon-moon" style="width: 50%;">夜间模式</p>
                                    <el-switch @change="changeStyle($event)" style="float: right;width: 20%" v-model="value" active-color="#409eff" inactive-color="#ff4949"></el-switch>
                                </div>
                                <div style="padding: 10px 10px 10px 10px;" class="familyBtn">
                                    <button class="activebtn" v-for="(item,index) in goods1" :key="index" :class="{'activeBtn':index === checkIndex1}" @click="changeBtn1(index)">{{item.text}}</button>
<!--                                    <button class="activebtn" v-for="(item,index) in goods2" :key="index" :class="{'activeBtn':index === checkIndex2}" @click="changeBtn2(index)">{{item.text}}</button>-->
                                </div>
                            <el-button style="border: 0;width: 100%;padding-left: 13px" slot="reference"><i :style="[fontSize,Aam]">Aa</i></el-button>
                        </el-popover>
                    </el-col>
                    <el-col :span="4" :sm="5" class="betaBtn" id="layerDemo">
                        <img style="cursor: pointer" class="beta" src="../assets/images/beta.png" alt="" @click="SwichBeta">
                        <div class="betaBtns" v-show="IsShows4">
                            <el-row>
                                <el-col>
                                    <p>简书钻相关功能，目前仅能在<br/> <a href="">简书App</a> 查看</p>
                                    <img src="../assets/erweima.png" alt="">
                                    <p>扫码下载 简书App</p>
                                    <button @click="SwichBeta">我知道了</button>
                                </el-col>
                            </el-row>
                        </div>
                    </el-col>
<!--                    <el-col :span="4">-->
<!--                        <router-link to="/login-dl" :style="[fontSize,textD]">登陆</router-link>-->
<!--                    </el-col>-->
<!--                    <el-col :span="5">-->
<!--                        <button :style="[buttons1]"><router-link to="/login-zhc" :style="[fontColor,textD]">注册</router-link></button>-->
<!--                    </el-col>-->
                    <el-col :span="6" :sm="6" class="User" :offset="0">
                        <div class="Users">
                            <img src="../assets/3.jpg" alt="">
                            <i class="el-icon-caret-bottom myphoto">
                            </i>
                            <template>
                                <ul class="Uhome">
                                    <router-link to="/MyC"><li><i class="el-icon-s-custom"></i><a>我的主页</a></li></router-link>
                                    <router-link to="/shoucang"><li><i class="el-icon-s-management"></i><a>收藏的文章</a></li></router-link>
                                    <router-link to="/xihuan"><li><i class="el-icon-star-on"></i><a>喜欢的文章</a></li></router-link>
                                    <router-link to="/yigouneirong"><li><i class="layui-icon layui-icon-rmb"></i><a>已购内容</a></li></router-link>
                                    <router-link to="/qianbao"><li><i class="el-icon-bank-card"></i><a>我的钱包</a></li></router-link>
                                    <router-link to="/mysetting"><li><i class="el-icon-s-tools"></i><a>设置</a></li></router-link>
                                    <router-link to="/bangzhuCont"><li><i class="el-icon-chat-line-square"></i><a>帮助与反馈</a></li></router-link>
                                    <router-link to="/login-dl"><li><i class="el-icon-more"></i><a style="color: #333333!important;">退出</a></li></router-link>
                                </ul>
                            </template>
                        </div>
                    </el-col>
                    <el-col :span="5" class="hidden-sm-and-down">
                        <el-button type="danger" round><router-link to="/edit" :style="[fontColor3,textD]">
                            <i class="layui-icon layui-icon-edit"></i>写文章
                        </router-link></el-button>
                    </el-col>
                </el-row>
            </el-col>
<!--            移动端-->
            <el-col :span="10" :xs="10" :offset="1" class="yd-header-p">
                <h2>创作你的创作</h2>
            </el-col>
            <el-col :span="7" :xs="7" class="yd-header-btn">
                <router-link to="">免费下载 <i class="el-icon-arrow-right"></i></router-link>
            </el-col>
        </el-row>
    </div>
</template>

<script>

    export default {
        name: 'app1',
        data(){
            return{
                value:false,
                show:false,
                shows2:'shows3',
                IsShows4:false,
                actives:1,
                input:'',
                checkIndex1:1,
                checkIndex2:0,
                goods1:[
                    {text:"宋体"},
                    {text:"黑体"},
                    ],
                goods2:[
                    {text:"简体"},
                    {text:"繁体"}
                ],
                list2:[
                    {path:'/',icon:'el-icon-discover',title:'发现'},
                    {path:'/myGuanzhu',icon:'el-icon-reading',title:'关注'},
                    {path:'/jianxinleft',icon:'el-icon-bell',title:'消息'}
                ],
                fontColor:{
                    color:'#ff4f4c'
                },
                fontColor3:{
                    color:'#fff'
                },
                Aam:{
                    marginRight:'20px',
                },
                fontSize:{
                    color:'#9b9b9b',
                    fontSize:'15px'
                },
                textD:{
                    fontSize:'15px',
                    textDecoration:'none',
                },
                fontColor2:{
                    display:'block',
                    width:'100%',
                    height:'100%',
                    color:'#3b3b3b'
                },
                Center:{
                    position: 'relative',
                    left:'50%',
                    transform: 'translateX(-50%)',
                },
                headerImg:{
                    width:'100px',
                    height:'56px'
                },
                headerLheight:{
                    lineHeight:'55px',
                },
                inputStyle:{
                    color:'#505050',
                    paddingLeft:'30px',
                    height:'30px',
                    border:'0',
                    borderRadius:'15px',
                },
                buttons1:{
                    backgroundColor:'#fff',
                    border:'1px solid #ff4f4c',
                    borderRadius:'30px',
                    width:'80px',
                    height:'40px'
                },
                textStyle:{
                    textAlign:'center'
                },
                mrBtn:{
                    fontSize:'10px',
                    marginRight:'15px'
                }
            }
        },
        methods:{
            changeTab2() {
                if(this.shows2=='shows3'){
                    this.shows2=''
                }
                else{
                    this.shows2='shows3'
                }
            },
            // changColor(index){
                // this.
            // },
            changeStyle($event){
                // console.log($event)
                if ($event==true){
                    var div = document.createElement('cover');
                    div.id="cover"
                    div.setAttribute('style','position:fixed;top:0;left:0;outline:5000px solid rgba(0,0,0,0.5);z-index:100;');
                    document.body.appendChild(div);
                }else if($event==false){
                    var div = document.getElementById('cover');
                    div.parentNode.removeChild(div);
                }
            },
            // 字体更换
            changeBtn1(index) {
                this.checkIndex1 = index
                if(index==0){
                    document.getElementsByTagName("body")[0].className="add_bg";
                }else if(index==1){
                    document.getElementsByTagName("body")[0].className="add_f";
                }
            },
            SwichBeta(){
                this.IsShows4=!this.IsShows4
            }
        },
        components: {

        },
        mounted() {

        }
    }
</script>

<style>
    #app1{
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 10;
        background-color: #f1f1f1;
    }
    .maxHeader{
        background-color: #fff;
        border-bottom: 1px solid #eee;
        box-shadow: 0 0 8px rgba(0,0,0,.1);
    }
    #History{
        position: absolute;
        top: -10px;
        left: -30%;
        z-index: 5;
        color: #9c9c9c;
        width: 215px;
        padding: 0px 10px 20px 10px;
        border-radius: 5px;
        background-color: #fff;
        box-shadow: 0 0 8px rgba(0,0,0,.1);
    }
    #History .el-col-9 button{
        margin-top: 0px;
        border: 0;
    }
    #History button{
        color: #9c9c9c;
        margin-top: 15px;
        border-radius: 20px;
        padding: 2px 5px 2px 5px;
        background-color: #fff;
        border: 1px solid #9c9c9c;
    }
    #app1 .el-row{
        width: 100%;
    }
    .beta{
        width: 56px;
        height: 25px;
    }
    .serch{
        color: #9c9c9c;
        margin-left: -10%;
    }
    .Search1::-webkit-input-placeholder {
        font-size: 12px;
        color: #9c9c9c;
    }
    .Search1{
        transition:all 1s;
        width: 55%;
        background-color: #eee;
    }
    .Search3:hover .serch{
        border-radius: 15px;
        width: 20px;
        height: 20px;
        color: #fff;
        padding: 5px 0px 0px 5px;
        background-color: #9c9c9c;
    }
    .Search3 input:hover{
        transition:all 1s;
        width: 70%;
    }
    .xiaoxi ,.Uhome{
        text-align: left;
        position: absolute;
        top: 55px;
        z-index: 5;
        background-color: #fff;
        display: none;
        width: 190px;
        border-radius: 2px;
        padding-top: 5px;
        padding-bottom: 5px;
        box-shadow: 0 0 8px rgba(0,0,0,.1);
    }
    .xiaoxi li , .Uhome li{
        font-size: 14px;
        width: 80%;
        height: 45px;
        margin-left: 10%;
    }
    .xiaoxi li:hover{
        width: 90%;
        margin-left:0;
        padding-left: 10%;
        background-color: #eeeeee;
    }
    .xiaoxi i ,.Uhome i{
        color: #ff4f4c;
        font-size: 18px;
        margin-right: 20px;
    }
    .XiaoXi :hover .xiaoxi{
        display: block;
        background-color: #fff;
    }
    .item{
        position: absolute!important;
        top: 0;
    }
    .HoverStyle :hover{
        background-color: #f7f7f7;
     }
    .dh-ttl1 li>a>p, .HoverStyle li>a>p{
        color: #1E9FFF;
    }
    .activebtn{
        width: 35%;
        height: 35px;
        border: 1px solid #eee;
        background-color: #fff;
        border-radius: 20px;
    }
    .activeBtn{
        background-color: #6dacf4;
    }
    .familyBtn button:nth-of-type(1),.familyBtn button:nth-of-type(3){
        border-radius:20px 0 0 20px;
        margin-left: 15%;
    }
    .familyBtn button:nth-of-type(2),.familyBtn button:nth-of-type(4){
        margin-top: 20px;
        border-radius: 0 20px 20px 0;
    }
    .activebtn:nth-of-type(1){
        font-family: 宋体;
    }
    .activebtn:nth-of-type(2){
        font-weight: 600;
        font-family: 黑体;
    }
    .add_bg{
        font-family: 宋体;
    }
    .add_f{
        font-family: 黑体;
    }
    .betaBtn>.el-message-box{
        width: 305px;
    }
    .betaBtns{
        text-align: center;
        position: fixed;
        left: 50%;
        z-index: 10;
        transform: translateX(-50%);
        background-color: #fff;
        width: 20%;
        min-width: 350px;
        border: 1px solid #f0f0f0;
        border-radius: 2px;
        padding: 20px 20px 50px 20px;
        box-shadow: 0px 150px 60px 1000px rgba(0,0,0,0.5);
    }
    .betaBtns p{
        font-size: 18px;
        color: #333333;
        line-height: 30px;
        margin: 5px 0 10px 0!important;
    }
    .betaBtns a{
        color: #ea6f5a;
    }
    .betaBtns img{
        width: 190px;
        height: 190px;
    }
    .betaBtns p:nth-of-type(2){
        font-size: 14px;
        color: #333333;
    }
    .betaBtns button{
        width: 190px;
        padding: 10px 0 10px 0;
        font-size: 14px;
        color: #fff;
        background-color: #ea6f5a;
        border: 0;
        margin-top: 10px;
        border-radius: 25px;
        cursor: pointer;
    }
    .User img{
        width: 42px;
        height: 42px;
        float: left;
        margin-top: 6px;
        border-radius: 50%;
    }
    .myphoto{
        position: absolute;
        top: 20px;
    }
    .User i{
        color: #9c9c9c;
        color: #9c9c9c;
    }
    .Users{
        padding-bottom: 56px;
        padding-left: 25px;
    }
    .Users:hover{
        background-color: #eeeeee;
    }
    .Users:hover .Uhome{
        display: block;
    }
    .Uhome {
        margin-left: -25px;
        width: 135px;
    }
    .Uhome li{
        font-size:14px;
        color: #333333;
    }
    .Uhome li:hover{
        width: 90%;
        margin-left: 0;
        padding-left: 10%;
        background-color: #eeeeee;
    }
    .Uhome i{
        margin-right: 10px;
        font-size: 14px;
        color: #ff4f4c;
    }
    /*移动端*/
    .yd-header-p ,.yd-header-btn{
        display: none;
    }
    .Home{
        display: none;
    }
    #app1 .router-link-exact-active{
        color: #ea6f5a !important;
    }
    .xiaoxi .router-link-exact-active li a{
        font-size: 16px;
        color: #ea6f5a !important;
    }
    .Uhome .router-link-exact-active li a{
        font-size: 16px;
        color: #ea6f5a !important;
    }
    @media screen and (max-width: 995px) {
        .HoverStyle , .dh-ttl1{
            display: none;
        }
        .Home{

            color: #333333;
            font-size: 30px;
            display: block;
        }
        .Home i:hover{
            color: #ea6f5a;
            /*transform: rotate(90deg);*/
            /*-webkit-transform: rotate(180deg);*/
            /*-moz-transform: rotate(180deg);*/
            /*-o-transform: rotate(180deg);*/
            /*-ms-transform: rotate(180deg);*/
        }
        .Home ul{
            font-size: 16px;
            display: none;
            z-index: 5;
            width: 100%;
            position: fixed;
            top: 52px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #fff;
            box-shadow: 0 0 8px rgba(0,0,0,.1);
        }
        .Home li{
            height: 35px;
            line-height: 35px;
            margin-top: 0;
            padding: 0px 0 0 15%;
            border-bottom: 1px solid #eee;
        }
        .Home li:hover{
            background-color: #f0f0f0;
        }
        .Home:hover ul{
            display: block;
        }
    }
    @media screen and (max-width: 750px) {
        .yd-header-p ,.yd-header-btn{
            font-size: 16px;
            display: block;
            line-height: 58px;
        }
        .yd-header-p h2{
            font-size: 16px;
            color: #333333;
        }
        .yd-header-btn a{
            font-size: 16px;
            color: #ea6f5a;
        }
    }
</style>